#ifndef STACK_H_INCLUDED
#define STACK_H_INCLUDED

#include <vector>
#include <stdio.h>

class _Stack
{
	std::vector<double>data;
	std::vector<char*>str;

	int strCount, pushCount;

	public:
	
	_Stack(int, int);
	bool ok();
	bool strOk();
	void push(double num);
	void pushString(char* str);
	double pop();
	void dump();
	void strDump();

};

_Stack::_Stack(int strCount, int pushCount)
{
	_Stack::strCount = strCount;
	_Stack::pushCount = pushCount;
}

bool _Stack::ok()
{
	if(_Stack::pushCount <= 0)
	{
		MessageBoxEx(NULL, "Stack error: Too less numbers in Stack", "BSCC::Stack", MB_OK);
		return false;
	}

	else return true;	
}

void _Stack::push(double num)
{
	if(_Stack::ok() == true)
	{
		_Stack::data [_Stack::pushCount] = num
		_Stack::pushCount ++;
	}
}

double _Stack::pop()
{
	if(_Stack::ok() == true && _Stack::pushCount >= 1)
	{
		return _Stack::data [_Stack::pushCount - 1];
		_Stack::data [_Stack::pushCount - 1] = 0;
		_Stack::pushCount --;
	}
}

bool _Stack::strOk()
{
	if(_Stack::strCount <= 0)
	{
		MessageBoxEx(NULL, "Stack error: Too less strings in Stack", "BSCC::Stack", MB_OK);
		return false;
	}
	else return true;	
}

void _Stack::pushString(char* str)
{
	if(_Stack::strOk() == true)
	{ 
		_Stack::str [_Stack::strCount] = str;
		_Stack::strCount ++;
	} 
}

void _Stack::dump()
{
	printf("\n\nStack::dump[%p], (", &_Stack::data);
	
	if(_Stack::ok() == true)
		printf("OK");

	else printf("LESS");

	printf(")\n{\n");

	for(int i = 0; i < _Stack::pushCount, i++)
		printf("    %d, %p;\n", _Stack::data[i], &_Stack::data[i]);	
	
	printf("Total: %d numbers.\n\n", _Stack::pushCount);
}

void _Stack::strDump()
{
	printf("String [%p] (", &_Stack::str);
	
	if(_Stack::strOk() == true)
		printf("OK");

	else printf("LESS");

	printf(")\n{\n");

	for(int i = 0; i < _Stack::strCount; i++)
		printf("    %d, %p;\n", _Stack::data[i], &_Stack::data[i]);

	printf("Total: %d strings.\n\n", _Stack::strCount);	
}

_Stack Stack(0, 0);

#endif